package com.example.testdemoutils.openFeign;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import javax.validation.Valid;

//此处name需要设置不为空，url需要在.properties中设置
@Service
@FeignClient(url = "https://one.aiskt.com", name = "service3")
public interface GptService3 {
    @PostMapping(value = "/v1/chat/completions")
    String getMessage(@Valid @RequestBody JSONObject jsonObject, @RequestHeader("Authorization") String tokenKey);
}
